<script setup lang="ts">
import { useAdmin } from "@/stores/admin";
import { ref } from "vue";
const adminStore = useAdmin();
const headImage = ref("");
if (adminStore.admin.avatar == "") {
  headImage.value = "/images/avatar-default.png";
} else {
  headImage.value = adminStore.admin.avatar;
}
</script>
<template>
  <section class="login_state">
    <div>
      <div><img :src="headImage" /></div>
      <div>{{ adminStore.admin.username }}</div>
    </div>
    <div>登录时间：{{ adminStore.admin.loginTime }}</div>
    <div>登录地点：{{ adminStore.admin.loginPlace }}</div>
  </section>
</template>

<style scoped>
.login_state {
  border: 1px solid #e4e7ed;
  border-radius: 5px;
  width: 25%;
  box-shadow: 0px 0px 5px 5px #e4e7ed;
  margin: 20px;
}
.login_state > div:first-child {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e4e7ed;
}
.login_state > div:first-child > div {
  margin: 10px 20px;
  font-size: 20px;
}
.login_state > div:not(:first-child) {
  line-height: 30px;
  margin: 10px 20px;
}
.login_state img {
  width: 50px;
  height: 50px;
}
</style>
